/*
 * p1394.cpp
 *
 *  Created on: 2013-4-23
 *      Author: zy
 */

#include<cstdio>
int n, m, k;
int main()
{
	while (scanf("%d%d%d", &n, &k, &m), n && m && k)
	{
		int x=0;
		for(int i=2;i<=n-1;i++)
			x=(x+k)%i;
		x=(x+m)%n;
		printf("%d\n",(x+1));
	}
	return 0;
}
